﻿using System;

namespace Oxage.Drivers
{
	public abstract class ConnectorBase : IConnector
	{
		#region IMachineController Members
		public abstract string Name { get; }

		public virtual void Open()
		{
		}

		public virtual void Close()
		{
		}

		public abstract void Write(byte[] data);

		public event EventHandler<ConnectorEventArgs> DataReceived;
		protected virtual void OnDataReceived(byte[] data)
		{
			if (DataReceived != null)
			{
				DataReceived(this, new ConnectorEventArgs() { Data = data });
			}
		}
		#endregion
	}
}
